﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace app1_mycalculator
{
    public static class Calculator
    {
        public static double PerformOperation(double a, double b, BaseOperation operate)
        {
            return operate.Calculate(a, b);
        }

        public static double Add(double a, double b)
        {
            return PerformOperation(a, b, new OperAdd());
        }

        public static double Sub(double a, double b)
        {
            return PerformOperation(a, b, new OperSub());
        }

        public static double Mul(double a, double b)
        {
            return PerformOperation(a, b, new OperMul());
        }

        public static double Div(double a, double b)
        {
            return PerformOperation(a, b, new OperDiv());
        }
    }
}
